/*TCSS 360 ConferenceGuru
 * 
 * Lawrence
 * Edited by Darrion
 */
package model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Observable;

/*
 * A class that represents a Subprogram Chair role in a conference.
 */
public class SubProgramChair extends Observable
							 implements Serializable
{
	private static final long serialVersionUID = 6909915660384729269L;
	private String my_user_name = "";
	//The list of assigned conference papers
	private ArrayList<ConferencePaper> my_assigned_manuscripts = new ArrayList<ConferencePaper>();
	
	/*
	 * The constructor which takes a list of papers that are chosen to be his
	 * responsibility and assigns it to my_manuscripts.
	 */
	public SubProgramChair(ArrayList<ConferencePaper> papers)
	{
		my_assigned_manuscripts.addAll(papers);
		
	}
	
	public void setName(String user_name)
	{
		my_user_name = user_name;
	}
	
	public String getName()
	{
		return my_user_name;
	}
	
	/*
	 * A method that returns the collection of assigned manuscripts.
	 */
	public Collection<ConferencePaper> getManuscripts()
	{
		return my_assigned_manuscripts;
	}
	
	/*
	 * A method that returns a collection of the ConferencePaper objects.
	 */
	public Collection<ConferencePaper> getMyPapers()
	{
		return my_assigned_manuscripts;
	}
	
	/*
	 * A method that takes and Reviewer and assigns them a ConferencePaper.
	 */
	public void assignManuscript(Reviewer the_reviewer, ConferencePaper manuscript)
	{
		the_reviewer.setManuscript(manuscript);
		setChanged();
		notifyObservers(this);
	}
	
	/*
	 * A method that returns the collection of available reviews for a specific
	 * ConferencePaper
	 */
	public Collection<Review> getReviews(ConferencePaper manuscript)
	{
		return manuscript.getReviews();
	}
	
	/*
	 * Sets the recommendation status for a specific ConferencePaper.
	 */
	public void submitRecommendation(String rec, ConferencePaper manuscript)
	{
		manuscript.setRecommendation(rec);
		setChanged();
		notifyObservers(this);
	}
	
	/*
	 * This method adds a manuscript to the list of assigned manuscripts. 
	 */
	public void addManuscipt(ConferencePaper the_paper)
	{
		my_assigned_manuscripts.add(the_paper);
	}

}
